package com.admission.model;

import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

//校园生活
@Entity
@Table(name = "environment")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Environment extends IdEntity {

	private String type;
	private String content;
	private List<EnvironmentPicture> enviromentPictures;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Lob
	@Basic(fetch = FetchType.LAZY)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "environment")
	public List<EnvironmentPicture> getEnviromentPictures() {
		return enviromentPictures;
	}

	public void setEnviromentPictures(
			List<EnvironmentPicture> enviromentPictures) {
		this.enviromentPictures = enviromentPictures;
	}
}
